<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport"
			content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>案例4.1 flex实现</title>
		<style>
			* {
				margin: 0;
				padding: 0;
			}

			.demo {
				display: flex;
				align-items: center;
				justify-content: space-between;
				flex-wrap: wrap;
				padding: 10px;
			}

			.demo div {
				width: 48%;
				height: 100px;
				margin-bottom: 20px;
				border: 1px solid #000;
			}
		</style>
	</head>
	<body>
		<div class="demo"> </div>
		<script type="text/javascript">
			function fill() {
				let s = ''
				for (let i = 0; i < 9; i++) {
					s += `<div></div>`
				}
				document.querySelector('.demo').innerHTML = s
			}
			fill()
		</script>
	</body>
</html>